package org.thanos.iot.util.response;

import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)
public class CommonPage<T> {

    private Long total;
    private List<T> result;

    /**
     * 将PageHelper分页后的list转为分页信息
     */
    public static <T> CommonPage<T> of(long total, List<T> list) {
        return new CommonPage<T>().setTotal(total).setResult(list);
    }
}
